package com.agileboot.attendance.domain.project.db.service.impl;

import com.agileboot.attendance.domain.project.entity.AttProjectEntity;
import com.agileboot.attendance.domain.project.db.AttProjectMapper;
import com.agileboot.attendance.domain.project.db.service.AttProjectService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * 项目服务实现类
 * 
 * @author ruoyi
 */
@Primary
@Service
public class AttProjectServiceImpl extends ServiceImpl<AttProjectMapper, AttProjectEntity> implements AttProjectService {

    @Override
    public AttProjectEntity getByProjectName(String projectName) {
        LambdaQueryWrapper<AttProjectEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AttProjectEntity::getProjectName, projectName)
                .eq(AttProjectEntity::getDeleted, false); // 使用基类的deleted字段
        return getOne(queryWrapper);
    }
} 